package com.why.catchMsg.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ResourceBundle;

/**
 * 配置文件读取
 * @author zhoumiao
 *
 */
public class PropertyHelper {

    private static ResourceBundle bundle = ResourceBundle.getBundle("sys");
    private  static Logger logger = LoggerFactory.getLogger("PropertyHelper");

    /**
     * 获取配置项值
     * @param key 键
     * @return value
     */
    public static String getValue(String key){
        if(bundle==null){
            logger.error("生成系统配置bundler失败");
            return "";
        }
        if(!bundle.containsKey(key)){
            logger.error("系统配置文件中未找到 "+key+" 对应的配置项值！");
            return "";
        }
        return bundle.getString(key);
    }

}
